<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<?php $this->load->view('head'); ?>
</head>

<body>
	<?php $this->load->view('header_admin.php'); ?>
	
	<!-- Load TinyMCE -->
	<script type="text/javascript" src="<?php echo site_url(); ?>assets/js/tiny_mce/jquery.tinymce.js"></script>
	<script type="text/javascript">
		jQuery().ready(function() {
			jQuery('textarea.tinymce').tinymce({
				// Location of TinyMCE script
				script_url : '<?php echo site_url(); ?>assets/js/tiny_mce/tiny_mce.js',
	
				// General options
				theme : "advanced",
				plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist",
	
				// Theme options
				theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
				theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
				theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
				theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
				theme_advanced_toolbar_location : "top",
				theme_advanced_toolbar_align : "left",
				theme_advanced_statusbar_location : "bottom",
				theme_advanced_resizing : true,
				submit_patch : false
			});
		});
	</script>
	<!-- /TinyMCE -->
	
	<script type="text/javascript">
		function submitForm() {
			jQuery('form#pageEdit').submit();
		}

		jQuery(document).ready(function() {
			jQuery("a#submitForm").click(function() {
				tinyMCE.triggerSave();
				
				jQuery('form#pageEdit').submit();

				return false;
			});
		});
	</script>
	
	<!-- Content Area -->
	<?php echo form_open('/edit/'.$pageEditing, 'id="pageEdit"'); ?>
	<div class="wrapper-world content">
		<div class="wrapper">
			<h1><?php echo $pageEditingName; ?></h1>
			
			<textarea name="content" class="tinymce" style="width: 900px; height: 300px;"><?php echo htmlspecialchars($page->content); ?></textarea><br/>
			<div class="type-btn">
				<input type="submit" name="submit" value="Submit" />
			</div>
			
			<div class="clr"></div>
		</div>
	</div> <!-- end of wrapper-world and .content -->
	</form>
		
	<div class="wrapper-world footer-top">
		<div class="wrapper"></div>	
	</div>
	
	<?php $this->load->view('footer'); ?>
</body>
</html>
